(0) Obligation:
Clauses:
transpose(A, B) :- transpose_aux(A, [], B).
transpose_aux(.(R, Rs), X1, .(C, Cs)) :- ','(row2col(R, .(C, Cs), Cols1, Accm), transpose_aux(Rs, Accm, Cols1)).
transpose_aux([], X, X).
row2col(.(X, Xs), .(.(X, Ys), Cols), .(Ys, Cols1), .([], As)) :- row2col(Xs, Cols, Cols1, As).
row2col([], [], [], []).
Query: transpose(g,a)
(1) PrologToDTProblemTransformerProof (SOUND transformation)
Built DT problem from termination graph DT10.
(2) Obligation:
Triples:
row2colA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) :- row2colA(X2, X4, X5, X6).
pB(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6), X7) :- row2colA(X2, X4, X5, X6).
pB(X1, X2, X3, .(X4, X5), X6, .(X7, X8)) :- ','(row2colcC(X1, X2, X3, .(X4, X5), X6), pB(X7, X4, X5, X9, X10, X8)).
transposeD(.(X1, X2), .(X3, X4)) :- pB(X1, X3, X4, X5, X6, X2).
Clauses:
row2colcA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) :- row2colcA(X2, X4, X5, X6).
row2colcA([], [], [], []).
qcB(X1, X2, X3, .(X4, X5), X6, .(X7, X8)) :- ','(row2colcC(X1, X2, X3, .(X4, X5), X6), qcB(X7, X4, X5, X9, X10, X8)).
qcB(X1, X2, X3, X4, X4, []) :- row2colcC(X1, X2, X3, X4, X4).
row2colcC(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6)) :- row2colcA(X2, X4, X5, X6).
Afs:
transposeD(x1, x2) = transposeD(x1)
(3) TriplesToPiDPProof (SOUND transformation)
We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
transposeD_in: (b,f)
pB_in: (b,f,f,f,f,b)
row2colA_in: (b,f,f,f)
row2colcC_in: (b,f,f,f,f)
row2colcA_in: (b,f,f,f)
Transforming
TRIPLES into the following
Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:
TRANSPOSED_IN_GA(.(X1, X2), .(X3, X4)) → U5_GA(X1, X2, X3, X4, pB_in_gaaaag(X1, X3, X4, X5, X6, X2))
TRANSPOSED_IN_GA(.(X1, X2), .(X3, X4)) → PB_IN_GAAAAG(X1, X3, X4, X5, X6, X2)
PB_IN_GAAAAG(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6), X7) → U2_GAAAAG(X1, X2, X3, X4, X5, X6, X7, row2colA_in_gaaa(X2, X4, X5, X6))
PB_IN_GAAAAG(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6), X7) → ROW2COLA_IN_GAAA(X2, X4, X5, X6)
ROW2COLA_IN_GAAA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → U1_GAAA(X1, X2, X3, X4, X5, X6, row2colA_in_gaaa(X2, X4, X5, X6))
ROW2COLA_IN_GAAA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → ROW2COLA_IN_GAAA(X2, X4, X5, X6)
PB_IN_GAAAAG(X1, X2, X3, .(X4, X5), X6, .(X7, X8)) → U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_in_gaaaa(X1, X2, X3, .(X4, X5), X6))
U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_out_gaaaa(X1, X2, X3, .(X4, X5), X6)) → U4_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, pB_in_gaaaag(X7, X4, X5, X9, X10, X8))
U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_out_gaaaa(X1, X2, X3, .(X4, X5), X6)) → PB_IN_GAAAAG(X7, X4, X5, X9, X10, X8)
The TRS R consists of the following rules:
row2colcC_in_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6)) → U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa([], [], [], []) → row2colcA_out_gaaa([], [], [], [])
U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcA_out_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6))
U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcC_out_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6))
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
pB_in_gaaaag(
x1,
x2,
x3,
x4,
x5,
x6) =
pB_in_gaaaag(
x1,
x6)
row2colA_in_gaaa(
x1,
x2,
x3,
x4) =
row2colA_in_gaaa(
x1)
row2colcC_in_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_in_gaaaa(
x1)
U11_gaaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U11_gaaaa(
x1,
x2,
x7)
row2colcA_in_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_in_gaaa(
x1)
U7_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U7_gaaa(
x1,
x2,
x7)
[] =
[]
row2colcA_out_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_out_gaaa(
x1,
x4)
row2colcC_out_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_out_gaaaa(
x1,
x5)
TRANSPOSED_IN_GA(
x1,
x2) =
TRANSPOSED_IN_GA(
x1)
U5_GA(
x1,
x2,
x3,
x4,
x5) =
U5_GA(
x1,
x2,
x5)
PB_IN_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6) =
PB_IN_GAAAAG(
x1,
x6)
U2_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAAAAG(
x1,
x2,
x7,
x8)
ROW2COLA_IN_GAAA(
x1,
x2,
x3,
x4) =
ROW2COLA_IN_GAAA(
x1)
U1_GAAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAAA(
x1,
x2,
x7)
U3_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8,
x9) =
U3_GAAAAG(
x1,
x7,
x8,
x9)
U4_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8,
x9) =
U4_GAAAAG(
x1,
x6,
x7,
x8,
x9)
We have to consider all (P,R,Pi)-chains
Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES
(4) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
TRANSPOSED_IN_GA(.(X1, X2), .(X3, X4)) → U5_GA(X1, X2, X3, X4, pB_in_gaaaag(X1, X3, X4, X5, X6, X2))
TRANSPOSED_IN_GA(.(X1, X2), .(X3, X4)) → PB_IN_GAAAAG(X1, X3, X4, X5, X6, X2)
PB_IN_GAAAAG(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6), X7) → U2_GAAAAG(X1, X2, X3, X4, X5, X6, X7, row2colA_in_gaaa(X2, X4, X5, X6))
PB_IN_GAAAAG(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6), X7) → ROW2COLA_IN_GAAA(X2, X4, X5, X6)
ROW2COLA_IN_GAAA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → U1_GAAA(X1, X2, X3, X4, X5, X6, row2colA_in_gaaa(X2, X4, X5, X6))
ROW2COLA_IN_GAAA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → ROW2COLA_IN_GAAA(X2, X4, X5, X6)
PB_IN_GAAAAG(X1, X2, X3, .(X4, X5), X6, .(X7, X8)) → U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_in_gaaaa(X1, X2, X3, .(X4, X5), X6))
U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_out_gaaaa(X1, X2, X3, .(X4, X5), X6)) → U4_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, pB_in_gaaaag(X7, X4, X5, X9, X10, X8))
U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_out_gaaaa(X1, X2, X3, .(X4, X5), X6)) → PB_IN_GAAAAG(X7, X4, X5, X9, X10, X8)
The TRS R consists of the following rules:
row2colcC_in_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6)) → U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa([], [], [], []) → row2colcA_out_gaaa([], [], [], [])
U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcA_out_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6))
U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcC_out_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6))
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
pB_in_gaaaag(
x1,
x2,
x3,
x4,
x5,
x6) =
pB_in_gaaaag(
x1,
x6)
row2colA_in_gaaa(
x1,
x2,
x3,
x4) =
row2colA_in_gaaa(
x1)
row2colcC_in_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_in_gaaaa(
x1)
U11_gaaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U11_gaaaa(
x1,
x2,
x7)
row2colcA_in_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_in_gaaa(
x1)
U7_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U7_gaaa(
x1,
x2,
x7)
[] =
[]
row2colcA_out_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_out_gaaa(
x1,
x4)
row2colcC_out_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_out_gaaaa(
x1,
x5)
TRANSPOSED_IN_GA(
x1,
x2) =
TRANSPOSED_IN_GA(
x1)
U5_GA(
x1,
x2,
x3,
x4,
x5) =
U5_GA(
x1,
x2,
x5)
PB_IN_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6) =
PB_IN_GAAAAG(
x1,
x6)
U2_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8) =
U2_GAAAAG(
x1,
x2,
x7,
x8)
ROW2COLA_IN_GAAA(
x1,
x2,
x3,
x4) =
ROW2COLA_IN_GAAA(
x1)
U1_GAAA(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U1_GAAA(
x1,
x2,
x7)
U3_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8,
x9) =
U3_GAAAAG(
x1,
x7,
x8,
x9)
U4_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8,
x9) =
U4_GAAAAG(
x1,
x6,
x7,
x8,
x9)
We have to consider all (P,R,Pi)-chains
(5) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 6 less nodes.
(6) Complex Obligation (AND)
(7) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
ROW2COLA_IN_GAAA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → ROW2COLA_IN_GAAA(X2, X4, X5, X6)
The TRS R consists of the following rules:
row2colcC_in_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6)) → U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa([], [], [], []) → row2colcA_out_gaaa([], [], [], [])
U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcA_out_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6))
U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcC_out_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6))
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
row2colcC_in_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_in_gaaaa(
x1)
U11_gaaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U11_gaaaa(
x1,
x2,
x7)
row2colcA_in_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_in_gaaa(
x1)
U7_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U7_gaaa(
x1,
x2,
x7)
[] =
[]
row2colcA_out_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_out_gaaa(
x1,
x4)
row2colcC_out_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_out_gaaaa(
x1,
x5)
ROW2COLA_IN_GAAA(
x1,
x2,
x3,
x4) =
ROW2COLA_IN_GAAA(
x1)
We have to consider all (P,R,Pi)-chains
(8) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(9) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
ROW2COLA_IN_GAAA(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → ROW2COLA_IN_GAAA(X2, X4, X5, X6)
R is empty.
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
[] =
[]
ROW2COLA_IN_GAAA(
x1,
x2,
x3,
x4) =
ROW2COLA_IN_GAAA(
x1)
We have to consider all (P,R,Pi)-chains
(10) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(11) Obligation:
Q DP problem:
The TRS P consists of the following rules:
ROW2COLA_IN_GAAA(.(X1, X2)) → ROW2COLA_IN_GAAA(X2)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(12) QDPSizeChangeProof (EQUIVALENT transformation)
By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.
From the DPs we obtained the following set of size-change graphs:
- ROW2COLA_IN_GAAA(.(X1, X2)) → ROW2COLA_IN_GAAA(X2)
The graph contains the following edges 1 > 1
(13) YES
(14) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PB_IN_GAAAAG(X1, X2, X3, .(X4, X5), X6, .(X7, X8)) → U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_in_gaaaa(X1, X2, X3, .(X4, X5), X6))
U3_GAAAAG(X1, X2, X3, X4, X5, X6, X7, X8, row2colcC_out_gaaaa(X1, X2, X3, .(X4, X5), X6)) → PB_IN_GAAAAG(X7, X4, X5, X9, X10, X8)
The TRS R consists of the following rules:
row2colcC_in_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6)) → U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6)) → U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_in_gaaa(X2, X4, X5, X6))
row2colcA_in_gaaa([], [], [], []) → row2colcA_out_gaaa([], [], [], [])
U7_gaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcA_out_gaaa(.(X1, X2), .(.(X1, X3), X4), .(X3, X5), .([], X6))
U11_gaaaa(X1, X2, X3, X4, X5, X6, row2colcA_out_gaaa(X2, X4, X5, X6)) → row2colcC_out_gaaaa(.(X1, X2), .(X1, X3), X4, .(X3, X5), .([], X6))
The argument filtering Pi contains the following mapping:
.(
x1,
x2) =
.(
x1,
x2)
row2colcC_in_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_in_gaaaa(
x1)
U11_gaaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U11_gaaaa(
x1,
x2,
x7)
row2colcA_in_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_in_gaaa(
x1)
U7_gaaa(
x1,
x2,
x3,
x4,
x5,
x6,
x7) =
U7_gaaa(
x1,
x2,
x7)
[] =
[]
row2colcA_out_gaaa(
x1,
x2,
x3,
x4) =
row2colcA_out_gaaa(
x1,
x4)
row2colcC_out_gaaaa(
x1,
x2,
x3,
x4,
x5) =
row2colcC_out_gaaaa(
x1,
x5)
PB_IN_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6) =
PB_IN_GAAAAG(
x1,
x6)
U3_GAAAAG(
x1,
x2,
x3,
x4,
x5,
x6,
x7,
x8,
x9) =
U3_GAAAAG(
x1,
x7,
x8,
x9)
We have to consider all (P,R,Pi)-chains
(15) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(16) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PB_IN_GAAAAG(X1, .(X7, X8)) → U3_GAAAAG(X1, X7, X8, row2colcC_in_gaaaa(X1))
U3_GAAAAG(X1, X7, X8, row2colcC_out_gaaaa(X1, X6)) → PB_IN_GAAAAG(X7, X8)
The TRS R consists of the following rules:
row2colcC_in_gaaaa(.(X1, X2)) → U11_gaaaa(X1, X2, row2colcA_in_gaaa(X2))
row2colcA_in_gaaa(.(X1, X2)) → U7_gaaa(X1, X2, row2colcA_in_gaaa(X2))
row2colcA_in_gaaa([]) → row2colcA_out_gaaa([], [])
U7_gaaa(X1, X2, row2colcA_out_gaaa(X2, X6)) → row2colcA_out_gaaa(.(X1, X2), .([], X6))
U11_gaaaa(X1, X2, row2colcA_out_gaaa(X2, X6)) → row2colcC_out_gaaaa(.(X1, X2), .([], X6))
The set Q consists of the following terms:
row2colcC_in_gaaaa(x0)
row2colcA_in_gaaa(x0)
U7_gaaa(x0, x1, x2)
U11_gaaaa(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(17) QDPSizeChangeProof (EQUIVALENT transformation)
By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.
From the DPs we obtained the following set of size-change graphs:
- U3_GAAAAG(X1, X7, X8, row2colcC_out_gaaaa(X1, X6)) → PB_IN_GAAAAG(X7, X8)
The graph contains the following edges 2 >= 1, 3 >= 2
- PB_IN_GAAAAG(X1, .(X7, X8)) → U3_GAAAAG(X1, X7, X8, row2colcC_in_gaaaa(X1))
The graph contains the following edges 1 >= 1, 2 > 2, 2 > 3
(18) YES